package edu.xcdq.service.impl;

import edu.xcdq.bean.News;
import edu.xcdq.dao.NewsDao;
import edu.xcdq.dao.impl.NewsDaoImpl;
import edu.xcdq.service.NewsService;
import org.junit.jupiter.api.Test;

import java.util.List;

public class NewsServiceImpl implements NewsService {
    private NewsDao newsDao = new NewsDaoImpl();

    @Override
    public List<News> getPageNews(int pageNo, int pageSize) {
        return newsDao.getPageNews(pageNo , pageSize);
    }

    @Override
    public int getTotalCount() {
        //获取新闻总数量
        return newsDao.getTotalCount();
    }

    @Test
    public void test(){
        int totalCount = getTotalCount();
        System.out.println(totalCount);
    }
}
